<?php

namespace app\controllers;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Cookie;

class TestController
{
	protected $request;

	public function __construct()
	{
		$this->request = Request::createFromGlobals();
	}

	/**
	 * @Route /test/{var}
	 * @param string $var
	 */
	public function index($var = "")
	{
		$http = new \Http();
		return $http->requestTest();

		//$data["time"] = date("H:i:s");
		//$data["files"] = get_included_files();
		//return $data;
	}

	public function a()
	{
		$data = "test a";

		return $data;
	}

	public function b()
	{
		$data = [];
		$len = 16;
		$num = 100000;
		for($i=0; $i<$num; $i++) {
			$code = uniqid_real($len);
			$data[$code] = 1;
		}
		$repeat = $num - count($data);

		prin(
			[
				"num" => $num,
				"repeat" => $repeat,
				"data" => $data,
			]
		);
	}
}
